<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
    <head>
    
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>平台财务表</title>
	<meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<link rel="stylesheet" type="text/css" href="/bsc/static/common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="/bsc/static/common/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="/bsc/static/css/personal.css" media="all">
</head>
<body>
<section class="layui-larry-box">
	<form class="form-inline" role="form" action="" method="post">
	 <input type="hidden" id="shopid" >
            <blockquote class="layui-elem-quote news_search">
 <div class="form-group">
      统计月份:
    <input type="month" class="form-control" name="ptime"  value="${map.ptime }" id="ptime">
  </div>
   店铺名称:
  <select class="form-control" name="shop_id" id="shop_id">
  <option value="-1">请选择</option>
  <c:forEach items="${list }" var="shop">
    <option value="${shop.shop_id }">${shop.shop_name }</option>
  </c:forEach>

</select>
  <button type="button"   class="btn btn-primary" onclick="cx()">查询</button>
  <div class="layui-inline">
    <button id="export" type="button" class="btn btn-primary"><span class="glyphicon glyphicon-pencil"></span>导出Excel</button>
  <button type="button"  class="btn btn-primary" onclick="cz()">重置</button>
</div>
   
  
  
  
	</blockquote>
            
		         <!-- 操作日志 -->
                <div class="layui-form news_list">
                    <table class="layui-table" id="tab" >
					    <colgroup>
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="15%">
					</colgroup>
					<thead>
						<tr >
							<td style="text-align:left;">编号</td>
							<td>店铺编号</td>
							<td>店铺名称</td>
							<td>店铺简称</td>
							<td>店铺现金收入</td>
							<td>店铺现金收入目标业绩</td>
							<td>完成率</td>
							<td>店铺消耗收入</td>
							<td>消耗收入目标业绩</td>
							<td>完成率</td>
							<td>免费颜值收入</td>
							<td>支付时间</td>
						</tr>
					</thead>
					<tbody class="news_content"  id="tb">
						<c:forEach items="${info.list }" var="re" varStatus="s">
						<tr >
							<td align="left">${s.index+1 }</td>
 							<td>${re.shop_id }</td> 
							<td>${re.shop_name }</td>
							<td>${re.short_name}</td>
							<td>${re.cash_income }</td>
							<td>${re.month_cash_in }</td>
							<td>${re.cm }</td>
							<td>${re.extend_income }</td>
							<td>
							${re.month_expend_in }
							</td>
							<td>
							${re.em }
							</td>
							<td>
							${re.free_num }
							</td>
							<td>
							<fmt:formatDate value="${re.pay_time }" pattern="yyyy-MM-dd"/>
							
							</td>
						</tr>
						</c:forEach>
					</tbody>
					</table>
                     
		</div>
		<div class="layui-inline">
  <a href="#" class="layui-btn layui-btn-normal" onclick="up()">上一页</a>   <a class="layui-btn layui-btn-normal" href="#" onclick="next()" >下一页</a>
</div>
		
	  </form> 
	

</section>
<script type="text/javascript" src="/bsc/static/common/layui/layui.js"></script>
<!-- <script type="text/javascript" src="../static/js/newslist.js"></script> -->
 <script type="text/javascript" src="/bsc/static/js/jquery.min.js"></script> 
<script type="text/javascript" src="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
<script type="text/javascript">
$(function(){
	 $('#export').click(function(){
			var trNum=$("#tab").find("tr").length ;//获取表格行数
			var tdNum=$("#tab").find("tr:eq(0)").find("td").length;//获取表格列数
			var arr="";
			for(i=0;i<trNum;i++){
				var str="";
				for(j=0;j<tdNum;j++){
					var info=$("#tab tr:eq("+i+") td:eq("+j+")").text();
					str=str+info+",";
				}
				str=str.substring(0,str.length-1);
				arr=arr+str+"%26";
			}
			window.location.href="/bsc/finance/export?arr="+arr;
	});
	
	
	  //下拉框定值
	 $("#shop_id").val(${map.shop_id});
});
//查询
function cx(){
	document.forms[0].action="/bsc/cashrecord/listshop";
	document.forms[0].submit();
};	
//上一页
function up(){
	document.forms[0].action="/bsc/cashrecord/listshop?page="+${info.prePage};
	document.forms[0].submit();
};
//下一页
function next(){
	document.forms[0].action="/bsc/cashrecord/listshop?page="+${info.nextPage};
	document.forms[0].submit();
};
//导出
function ex(){
	document.forms[0].action="/bsc/shop/export.do";
	document.forms[0].submit();
}
//重置
 function cz(){
	$("#shop_id").val("-1");
	$("#ptime").val("");
} 
</script>
</body>
</html>